import {reqGoodsListInfo} from '@/api'

const state={
    goodsListInfo:[]
}
const mutations={
    GETGOODSLISTINFO(state,goodsListInfo){
        state.goodsListInfo=goodsListInfo
    }
}
const actions={
    async getGoodsListInfo({commit},requestOptions){
        const result =await reqGoodsListInfo(requestOptions)
        if(result.code===200) commit('GETGOODSLISTINFO',result.data)
    }
}
const getters ={
    trademarkList(state){
        // console.log(state);
        return state.goodsListInfo.trademarkList||[]
    },
    attrsList(state){
        return state.goodsListInfo.attrsList||[]
    },
    goodsList(state){
        return state.goodsListInfo.goodsList||[]
    }
    
}

export default {
    state,
    mutations,
    actions,
    getters,
}